/**
 * 
 */
package com.learn.security.validator;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import javax.validation.Constraint;
import javax.validation.Payload;

/**
 * 自定义校验器
 * 1.@Target指定作用对象
 * 2.@Retention注解类的生命周期
 * 3.@Constraint 声明用什么类校验
 */
@Target({ElementType.METHOD, ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
@Constraint(validatedBy = MyConstraintValidator.class)
public @interface MyConstraint {
	
	String message() default "{此处填写默认信息}";

	Class<?>[] groups() default { };

	Class<? extends Payload>[] payload() default { };

}
